﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addwholesale.aspx.cs" Inherits="WebSite.admin.shop.addwholesale" %>

 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>上海万礼通网络科技后台管理系统</title>
    <link href="../main.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
        parent.maintitle.innerHTML = "促销管理";
        parent.contentmain.innerHTML = "<span class='title01'>所在位置：</span>添加批发方案。&nbsp;&nbsp;<img src='images/sort_desc.gif' /> <a href='shop/wholesale.aspx' target='content'><font color=#ff0000>批发方案列表</font></a>"
    </script>
    <script language='javascript'>
        var path = (window.top.location).toString();
        if (path.indexOf('login.aspx') == -1) {
            if (path.indexOf('index.aspx') == -1) {
                window.top.location = 'index.aspx';
            }
        }
    </script>
    <script type="text/javascript" language="javascript">
        var i = 1
        function addFile() {
            if (i < 8) {
                var str = '<BR>&nbsp;&nbsp;&nbsp; 数量：<input name="text" type="text" maxlength="20" />&nbsp;价格：<input name="text1" type="text" maxlength="20" />'
                document.getElementById('MyFile').insertAdjacentHTML("beforeEnd", str)
            }
            else {
                alert("您一次最多只能上传8条！")
            }
            i++
        } 
   </script> 
   <script language="JavaScript" src="../../js/function.js"></script>
    <script language="javascript">
        function CheckSelect(del, str) {
            var rt = true;
            var num = 0;
            var boxorder = 0;
            var objCheckBox;
            for (var i = 0; i < form1.length; i++) {
                //alert(form1.elements[i].name);
                //if((form1.elements[i].type=="checkbox")&&(form1.elements[i].name=="rankid"))
                if (form1.elements[i].name == 'rankid') {
                    // alert("ok");
                    boxorder++;
                    objCheckBox = form1.elements[i];
                    //alert(boxorder);
                    if (objCheckBox.checked) {

                        //如果是第一个CheckBox，是用来全选全消的，这个不算，不用自加
                        num++;
                    }
                }
            }
            //alert(num);
            if (!del) {
                if (num > 1) {
                    alert("此操作不允许选择多个事件");
                    rt = false;
                }
            }
            if (str == 'del') {
                if (num == 0) {
                    alert("你没有选择要删除的信息");
                    rt = false
                } else { return confirm('你确定要删除这些信息吗?'); }
                ///alert(rt);
            }
            else {
                if (str == 'update') {
                    if (num == 0) {
                        alert("你没有选择适用会员等级");
                        rt = false
                    } //else{return confirm('你确定要更新这些信息吗?');}
                    ///alert(rt);
                } 
            }
            return rt;
        }
        function CheckFrm() {
            var obj = 'proname';
            var objt = '5';
            var msg = '商品名称';
            var chks = chk(form1, obj, objt, msg)
            if (!chks) {
                return false;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#F1F4F7">
<tr>
<td height="382" align="center" valign="top">
<table width="90%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FAFBFC" class="img">
    <tr>
      <td width="5%" align="right">根据商品名称或货号搜索商品</td>
      <td align="left" style="width: 8%"><input id="keyname" name="keyname" runat="server" /><asp:ImageButton ID="ImageButton2" ImageUrl="../images/button04.gif" runat="server" OnClick="ImageButton2_Click" /></td>
    </tr>
    <tr>
      <td width="5%" align="right">批发商品名称：</td>
      <td align="left" style="width: 8%"><asp:DropDownList ID="proname" runat="server">
          </asp:DropDownList></td>
    </tr>
    <tr>
      <td width="5%" align="right">适用会员等级：</td>
      <td align="left" style="width: 8%"><asp:DataList ID="DataList1" runat="server" RepeatColumns="4" CellPadding="1" ForeColor="#333333" Height="100%" Width="98%">
          <ItemTemplate>
          <input name="rankid" id="rankid" value="<%# DataBinder.Eval(Container.DataItem, "rankid") %>" type="checkbox" />
          <%# DataBinder.Eval(Container.DataItem, "rank") %>
          </ItemTemplate></asp:DataList>
      </td>
    </tr>
    <tr>
      <td width="5%" align="right">是否启用：</td>
      <td align="left" style="width: 8%"><asp:CheckBox ID="visible" Checked="true" runat="server" /></td>
    </tr>
  </table>
  <br />
  <asp:Panel ID="Panel5" runat="server" Width="100%"> 
  <table width="90%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FAFBFC" class="img">
    <tr>
      <td>
      <asp:DataList ID="DataList2" runat="server" RepeatColumns="1" CellPadding="0" ForeColor="#333333" Width="98%">
       <ItemTemplate>
               <a href="javascript:;" onclick="if (confirm('您确实要删除该类别吗？')) window.location.href='addwholesale.aspx?sid=<%# DataBinder.Eval(Container.DataItem, "saleid")%>&amp;action=del';">[-]</a>
               数量：<input value="<%# DataBinder.Eval(Container.DataItem, "nums")%>"  name="content_<%# DataBinder.Eval(Container.DataItem, "saleid")%>" id="content_<%# DataBinder.Eval(Container.DataItem, "saleid")%>" />&nbsp;价格：<input value="<%# DataBinder.Eval(Container.DataItem, "prices")%>"  name="prices_<%# DataBinder.Eval(Container.DataItem, "saleid")%>" id="prices_<%# DataBinder.Eval(Container.DataItem, "saleid")%>" />
        </ItemTemplate>
      </asp:DataList>    
              </td>
          </tr>
    <!-- 上传图片 -->
    <tr>
      <td align="left"><P id="MyFile">
      <a onclick="addFile()" href="#">[+]</a> 数量：<input name="text" type="text"  maxlength="20" />&nbsp;价格：<input name="text1" type="text"  maxlength="20" />
        </P></td>
    </tr>
  </table>
  </asp:Panel>
  <br />
  <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="26%" align="left">&nbsp;
          <asp:ImageButton ID="ImageButton1" ImageUrl="../images/button02.gif" runat="server" OnClick="ImageButton1_Click" /></td>
    </tr>
  </table></td>
</tr>
</table>
    </div>
    </form>
</body>
</html>
